<?php
use think\facade\Route;

/** 接口路由 卡券-打折卡 - 后台*/
Route::group('admin/coupon/discountCard', function () {
    // 打折卡列表
    Route::get('list', 'index');
    // 创建打折卡
    Route::get('create', 'create');
    Route::post('create', 'create');
    // 编辑打折卡
    Route::get('<id>/edit', 'edit')->pattern(['id' => '\d+']);
    Route::put('<id>/edit', 'edit')->pattern(['id' => '\d+']);
    // 删除打折卡
    Route::delete('<id>/delete', 'delete')->pattern(['id' => '\d+']);
    // 领取以及使用详情
    Route::get('<coupon_id>/details', 'details')->pattern(['coupon_id' => '\d+']);
})->prefix('\app\course\service\coupon\admin\DiscountCard@')->append(['online' => 1])->middleware(['adminRoute']);

/** 线下卡券-打折卡 - 后台*/
Route::group('admin/coupon/offline/discountCard', function () {
    // 打折卡列表
    Route::get('list', 'index');
    // 创建打折卡
    Route::get('create', 'create');
    Route::post('create', 'create');
    // 编辑打折卡
    Route::get('<id>/edit', 'edit')->pattern(['id' => '\d+']);
    Route::put('<id>/edit', 'edit')->pattern(['id' => '\d+']);
    // 删除打折卡
    Route::delete('<id>/delete', 'delete')->pattern(['id' => '\d+']);
    // 领取以及使用详情
    Route::get('<coupon_id>/details', 'offlineDetatils')->pattern(['coupon_id' => '\d+']);
    // 导出
    Route::post('export', 'export');
})->prefix('\app\course\service\coupon\admin\DiscountCard@')->append(['online' => 0])->middleware(['adminRoute']);
